package BaseService

import (
	"gdshop-back-end-go/client-api/app/request/HomeReq"
	"gdshop-back-end-go/common/libs/clickCaptcha"
	"gdshop-back-end-go/common/response"
	"github.com/gogf/gf/net/ghttp"
)

func Captcha(r *ghttp.Request, parames *HomeReq.Captcha) *response.JsonResponse {
	ctx := r.GetCtx()
	data, err := clickCaptcha.Generate(ctx)
	if err != nil {
		return response.FailByRequestMessage(r, "获取失败")
	}

	return response.SuccessByRequestMessageData(r, "获取成功", data)
}
